#!/usr/bin/ruby
# -*- coding: UTF-8 -*-

=begin 
@author = sirius
@time = 2017.11.11
=end

# if 修饰符
$debug=false
print "debug\n" if $debug 

# unless 语句
x=1
unless x>2
   puts "x 小于 2"
 else
  puts "x 大于 2"
end

# unless 修饰符
$var =  1
print "1 -- 这一行输出\n" if $var
print "2 -- 这一行不输出\n" unless $var
 
$var = false
print "3 -- 这一行输出\n" unless $var

# case 语句
$age =  5
case $age
when 0 .. 2
    puts "婴儿"
when 3 .. 6
    puts "小孩"
when 7 .. 12
    puts "child"
when 13 .. 18
    puts "少年"
else
    puts "其他年龄段的"
end


foo = false
bar = true
quu = false
 
case
when foo then puts 'foo is true'
when bar then puts 'bar is true'
when quu then puts 'quu is true'
end
# 显示 "bar is true"
